function Header($) {
	return {
		init:function(){
			var _this = this;
			$(".header-top").find(".logo").on("click",function(){
				window.location.href="/";
			})
			$(".header-top").find(".menu").on("click",function(){
				if(!$(this).hasClass("tg")){
					$(".header").addClass("active");
					$(this).addClass("tg");
				}else{
					$(".header").removeClass("active");
					$(this).removeClass("tg");
				}
			});
			$("#buy_online").on("change",function () {
				if($(this).val() == "2"){
					_this.getHits(2);
					location.href = "https://acdelco.tmall.com";
				}else if($(this).val() == "1"){
					_this.getHits(1);
					location.href = "https://mall.jd.com/index-749060.html";
				}
			})
			$("#sel_locale").on("change",function(){
				if($(this).val() == "2"){
					location.href = "https://www.acdelco.com";
				}
				else{
					location.href = "/";
				}
			});
		},
		getHits: function(tg){
			$.ajax({
				url:"https://www.acdelco.com.cn/clickstatistics/addCount.json",
				// url:"http://192.168.0.110:8080/clickstatistics/addCount.json",
				data:{
					playType: 2,
					urlType: tg
				},
				type:'get',
				success:function(res){
					console.log(tg);
				}
			})
		}
	}
}
if("function"==typeof define && define.amd && define){
	define(['zepto'],function($){
		return Header($);
	});
}